package com.cskaoyan.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * @author stone
 * @date 2022/06/21 14:45
 */
@Data
public class BaseRespVo<T> {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    T data;
    String message;
    int errno;

    public static BaseRespVo ok() {
        BaseRespVo baseRespVo = new BaseRespVo();
        baseRespVo.setMessage("成功");
        baseRespVo.setErrno(200);
        return baseRespVo;
    }
    public static <T> BaseRespVo ok(T data) {
        BaseRespVo baseRespVo = new BaseRespVo();
        baseRespVo.setData(data);
        baseRespVo.setMessage("成功");
        baseRespVo.setErrno(200);
        return baseRespVo;
    }
}
